using System;
using UnityEngine;

public class Environment : MonoBehaviour
{
	[Serializable]
	public struct Properties
	{
		public Mineral mineral;

		public Material collectVFX;

		public Sprite mineralOnCabin;
	}

	[SerializeField]
	private Properties[] properties;

	[SerializeField]
	private SpriteRenderer mineralOnCabin;

	[SerializeField]
	private ParticleSystemRenderer collectUp;

	[SerializeField]
	private ParticleSystemRenderer collectDown;

	public void Initialize(Mineral mineral)
	{
		Properties properties = Array.Find(this.properties, (Properties target) => target.mineral == mineral);
		collectUp.material = properties.collectVFX;
		collectDown.material = properties.collectVFX;
		mineralOnCabin.sprite = properties.mineralOnCabin;
	}
}
